package work.mediway.mdm.biz.entity.biz;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 任务结果记录
 *
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2021/1/18
 */
@ApiModel(value = "任务结果记录")
@Data
@TableName(value = "User_BTEventLog")
public class UserBTEventLog {

    /**
     * id
     */
    @TableId(value = "User_BTRowID", type = IdType.AUTO)
    @ApiModelProperty(value = "id")
    private String btRowId;

    /**
     * 代码
     */
    @TableField(value = "User_BTCode")
    @ApiModelProperty(value = "代码")
    private String btCode;

    /**
     * 数据总量
     */
    @TableField(value = "User_BTTotalNumber")
    @ApiModelProperty(value = "数据总量")
    private String btTotalNum;

    /**
     * 增长情况
     */
    @TableField(value = "User_BTInCrease")
    @ApiModelProperty(value = "增长情况")
    private String btIncrease;

    /**
     * 当前ID
     */
    @TableField(value = "User_BTCurrentID")
    @ApiModelProperty(value = "当前ID")
    private String btCurrentId;

    /**
     * 明细
     */
    @TableField(value = "User_BTDetails")
    @ApiModelProperty(value = "明细")
    private String btDetails;

    /**
     * 最后更新日期
     */
    @TableField(value = "UpdateDate")
    @ApiModelProperty(value = "最后更新日期")
    private String lastUpdateDate;

    /**
     * 最后更新时间
     */
    @TableField(value = "UpdateTime")
    @ApiModelProperty(value = "最后更新时间")
    private String lastUpdateTime;

    public UserBTEventLog() {
    }

    public UserBTEventLog(String btCode, String btDetails, String date) {
        this.btCode = btCode;
        this.btDetails = btDetails;
        String[] dates = StrUtil.splitToArray(DateUtil.now(), " ");
        this.lastUpdateDate = date;
        this.lastUpdateTime = dates[1];
        this.btTotalNum = "0";
    }
}